package com.example.pro1.valu;

import lombok.Data;
import lombok.Getter;
import lombok.experimental.Accessors;

import java.util.HashMap;
import java.util.Map;


@Data
@Accessors(chain = true)
public class Standard {
    private Integer code;//响应码
    private String  message;//响应消息
    private Map<String,Object> data=new HashMap<>();//响应内容

    public static Standard ok()
    {
        Standard r=new Standard();
        r.setCode(0);
        r.setMessage("Jack slow funck!");

        return r;
    }
    public static Standard nonono()
    {
        Standard r=new Standard();
        r.setCode(-1);
        r.setMessage("keep out!");
        return r;
    }

    public  Standard data(String key,Object value)
    {

        //this.setCode(0);
        //this.setMessage("Jack slow funck!");
        this.data.put(key,value);
        return this;
    }
}
